Commonly Used Extensions - Visual Studio
TLDR
- Extension Management: It is recommended to use an "independent list" rather than installing large bundles to avoid issues with overlapping features, outdated components, or incomplete uninstallation.
- Font Selection:
Cascadia Monois recommended; it is designed for code and performs excellently on high-resolution screens. AvoidCascadia Codeto prevent ligatures from causing confusion in symbol interpretation. - Entity Framework Core: For projects not building Entities, you only need to install
Microsoft.EntityFrameworkCore, a database provider (e.g.,SqlServer), andRelational. - Log Management:
Serilogis recommended. Its structured logging (Data) is far superior to the traditional text-based logging ofNLog. It is recommended to pair it withSeqfor visual debugging. - DI Enhancement: Use
Scrutorto fill the gap where Microsoft's native DI does not support Assembly Scanning. - Reverse Proxy: Microsoft's official
YARPhas replacedOcelotas the top choice for new projects due to its high integration with .NET and superior performance. - Compression Packages: If there are requirements for data to remain in-memory or for encryption, prioritize using native
System.IO.Compressionor in-memory processing packages to avoid security risks caused by calling external7z.exeand generating temporary files.
Visual Studio Extension Recommendations
In the Visual Studio development environment, it is recommended to break down large bundles into individual extensions.
Why is an independent list recommended?
You may encounter management chaos when you are accustomed to installing large bundles like "Productivity Power Tools" or "Web Essentials".
- Opaque Content: You cannot precisely track which tools are installed, and the content often changes with versions.
- Overlapping and Outdated Features: With Visual Studio updates, many old features have been replaced by built-in functionality (e.g., Zen-Coding).
- Incomplete Removal: When removing a bundle, sub-extensions often remain in the environment.
Recommended Extension List
- Productivity Power Tools Related:
Double-Click Maximize 2022: Double-click to maximize the window.Fix Mixed Tabs: Detects and converts mixed usage of Tabs and spaces.Middle Click Scroll: Use the mouse wheel to scroll through documents.Solution Error Visualizer: Displays error hints in Solution Explorer.
- Dev Essentials Related:
File Icons: Beautifies file icons.SVG Viewer: Optimizes SVG preview and editing.Editor Enhancements: Enhances code sorting and encoding features.Markdown Editor v2: Enhances the Markdown editing experience.Image Optimizer: Image compression.
- Other Useful Tools:
ResXManager: Multi-language management, provides an Excel-like interface.Editor Guidelines: Sets code length guide lines (recommended 80, 100, 120 chars).VSColorOutput: Adds color differentiation to Build messages in the Output window.
Visual Studio Environment and Editor Settings
Display and Font Optimization
When to adjust fonts: When you are developing for long periods on a high-resolution screen.
- Font Selection:
Cascadia Mono(size 12) is recommended. - Avoiding Ligature Issues: Choosing
Cascadia Monoinstead ofCascadia Codeis to avoid ligature effects like!=automatically converting to≠, which can cause confusion in symbol interpretation. - Screen Display: If the mouse pointer behaves erratically during operation (common in SQL files), try disabling "Optimize rendering for screens with different pixel densities".
Advanced Editor Settings
- Document Tabs: It is recommended to set the position to "Left" or "Right" to increase vertical reading space, and enable "Color tabs by project or file type".
- C# Advanced Settings:
- Outlining: Enable "Show procedure line separators" to use white lines to separate methods and properties.
- Fading: Enable fade-out reminders for redundant Usings and variables.
- Editor Help: Enable "Underline reassigned variables" to make it easier to track variable states.
NuGet Package Selection Strategy
Database and ORM
- EF Core: For projects not building Entities, you only need to install
Microsoft.EntityFrameworkCore,Microsoft.EntityFrameworkCore.SqlServer(or the corresponding provider), andMicrosoft.EntityFrameworkCore.Relational. - Dapper: The top choice for a lightweight ORM.
- EF Core Power Tools: Provides a graphical interface for reverse engineering, making it easy to generate Models from a database.
Logging and Architecture Enhancement
- Serilog.AspNetCore: The modern standard for structured logging.
- Core Concept: Log "data" rather than "strings". For example,
Log.Info("User {Id}", id)treatsIdas a searchable field. - Recommended Combination: Pair with
Serilog.Sinks.Seqfor visual debugging.
- Core Concept: Log "data" rather than "strings". For example,
- Scrutor: Enhances Microsoft's native DI, filling the gap where Assembly Scanning is not supported.
Networking and Compression
- YARP: The official reverse proxy package led by Microsoft. It performs better than Ocelot and is suitable for new projects.
- Compression Package Selection:
- If the project already has
NPOI, you can directly use its dependencySharpZipLib. - If there are no special dependencies,
DotNetZipis sufficient. - Security Reminder: Avoid calling external programs like
7z.exe. Use nativeSystem.IO.Compressionor in-memory processing instead to prevent sensitive data leaks caused by residual temporary files.
- If the project already has
Project Versioning
- MinVer: Suitable for lightweight projects; determines the version based on Git Tags.
- GitVersion.MsBuild: Suitable for projects with complex branching strategies (e.g., GitFlow).
Change Log
- 2022-11-10 Initial document creation.
- 2025-04-06
- Added settings instructions for "Automatically update extensions".
- Removed "Code Cleanup on Save" as it has been built into Visual Studio 2022 for a long time and does not need to be listed separately.
- Updated descriptions for some packages.
- 2025-12-31
- Removed outdated and commercial-license-required packages.
- Updated Visual Studio setting recommendations; now recommending the Cascadia font family.
- Added packages such as YARP, Scrutor, and MQTTnet.